<?php
function addMessage($uid, $db, $name, $sex, $phone_number, $age, $address, $invote_user_id, $rc_code) {
	$create_time = date("Y-m-d his");
	$return = $db->mysqli_query("INSERT INTO 'zt_user' ('user_id', 'user_name', 'sex', 'create_time', 'phone_number', 'age', 'address', 'invote_user_id', 'rc_code', 'status') VALUES ($uid,$name,$sexs,$create_time,$phone_number,$age,$address,$invote_user_id,$rc_code,0)");
	if ($return) {
		return true;
	} else {
		return false;
	}
}

function addPoint($invote_uid, $db) {
	$return = $db->mysqli_query("UPDATE 'zt_user' SET 'point'='point'+1, WHERE user_id=$invote_uid");
	$ff_uid = $db->mysqli_query("SELECT invote_user_id FROM zt_user WHERE user_id=$invote_uid");
	$return = $db->mysqli_query("UPDATE 'zt_user' SET 'point'='point'+1, WHERE user_id=$ff_uid");
	if ($return) {
		return true;
	} else {
		return false;
	}
}
?>

